package club.banyuan;

import java.io.IOException;
import java.net.*;

public class UdpSent {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket = new DatagramSocket();
        String msg = "你猜我猜不猜？！";
        byte[] bytes = msg.getBytes();
        InetAddress address = InetAddress.getByName("192.168.11.255");
        DatagramPacket datagramPacket = new DatagramPacket(bytes, 0, bytes.length, address, 9999);
        datagramSocket.send(datagramPacket);
        datagramSocket.close();
    }
}
